import request from '@/utils/request'

export default {

    //1 添加课程信息
    addCourseInfo(courseInfo) {
        return request({
        //   url: '/table/list/'+current+"/"+limit,
        //是  ``     不是''
            url:'/eduservice/course/addCourseInfo',
          method: 'post',
   
            data:courseInfo
        })
      },
      //查询所有讲师
      getListTeacher(){
        return request({

            url:'/eduservice/teacher/findAll',
            method:'get',
            

        })
      },
      //根据id查询课程信息
      getCourseInfoId(id){
            return request({
                url :'/eduservice/course/getCourseInfo/'+id,
                method :'get'
            })
      },
      //修改课程信息
      updateCourseInfo(courseInfo){
        return request({
          url:'/eduservice/course/updateCourseInfo',
          method:'post',
          data:courseInfo
        })
      },
      //课程信息确认显示
      getPublishCourseInfo(id){
        return request({
          url:'/eduservice/course/getPublishCourseInfo/'+id,
          method:'get'
      
        })

      },
      //课程最终发布
      PublishCourse(id){
        return request({
          url:'/eduservice/course/publishCourse/'+id,
          method:'post'
      
        })

      },
       //所有课程
       getCoursesList(){
        return request({
          url:'/eduservice/course/getCourseList',
          method:'get'
      
        })

      },
      //条件查询带分页
      getCourseListPage(current,limit,courseQuery){
            return request({

              url:`/eduservice/course/pageCourseCondition/${current}/${limit}`,
              method:'post',
              data:courseQuery
            })
      },
            //删除课程
            removeCourse(id){
              return request({
                url:'/eduservice/course/'+id,
                method:'delete'
            
              })
            }

    }